﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Nvigorate.Relational.Mapping.Interface;

namespace Nvigorate.Relational.Mapping
{
    [Serializable]
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple= true, Inherited = true)]
    public class SourceAssignment : Attribute
    {
        public string MapSet { get; set; }
        public string Source { get; set; }
        public List<QueryTypes> ForbiddenOperations { get; set; }

        public SourceAssignment(string source)
        {
            Source = source;
            ForbiddenOperations = new List<QueryTypes>();
        }

        public SourceAssignment(string mapSet, string source)
        {
            MapSet = mapSet;
            Source = source;
            ForbiddenOperations = new List<QueryTypes>();
        }

        public SourceAssignment(string mapSet, string source, params QueryTypes[] forbiddenOperations)
        {
            MapSet = mapSet;
            Source = source;
            ForbiddenOperations = forbiddenOperations.ToList();
        }
    }
}